package org.lem

import java.text.DateFormat

class StudentLearningSkill {

  static belongsTo = [student:Student]

  Date dateTested
  Volunteer testedBy
  int testScorePart1
  int testScorePart2
  int testScorePart3
  int testScorePart4
  String inputBy
  Date inputDate

  static constraints = {
    student()
    dateTested()
    testedBy(nullable:true)
    testScorePart1()
    testScorePart2()
    testScorePart3()
    testScorePart4()
    inputBy()
    inputDate()
  }

  String toString() {
    //TODO: date formatting needs some  help -- shows up as Month Day Year with year having format of 0009 or 0010
    "${dateTested.format("MMM d yyyy")} -- ${testScorePart1} ${testScorePart2} ${testScorePart3} ${testScorePart4}"
  }
}
